<?php

require_once "config/options.php";
smartload("lib/functions.php");
smartload("lib/exceptions.php");
smartload("lib/inflector.php");
smartload("lib/inflections.php");
smartload("lib/session.php");
smartload("lib/base.php");
smartload("lib/cache.php");
smartload("lib/dispatcher.php");
smartload("lib/flash.php");
smartload("lib/activerecord.php");
smartload("lib/actioncontroller.php");
smartload("lib/helpers.php");
smartload("lib/helpers/active_record_helper.php");
smartload("lib/helpers/url_helper.php");
smartload("lib/helpers/form_helper.php");
smartload("lib/helpers/form_tag_helper.php");
smartload("lib/helpers/date_helper.php");
smartload("lib/helpers/asset_tag_helper.php");
smartload("lib/helpers/javascript_helper.php");
smartload("lib/actionview.php");

function smartload($file){

	$key="sl_$file";
	if(Cabbie::$class_cache === true) $classdata=apc_fetch($key);
	else $classdata = false;
	if($classdata === false) {
		$classdata=file_get_contents(Cabbie::$root."/".$file);
		if(Cabbie::$class_cache === true) apc_store($key, $classdata, Cabbie::$class_cache_ttl);
	}
	eval("?>" . $classdata . "<?");
 }
?>